import java.util.Scanner;

public class test4 {
    public static void main10(String[] args) {
        int n = 7;
        int i;
        for (i = 2; i < n; i++) {
            if(n % i ==0) {
                System.out.println("不是素数");
                break;
            }
            if(n == i) {
                System.out.println("是素数");
            }
        }
    }
    public static void main9(String[] args) {
        int n = 7;

        for (int i = 31; i >= 1 ; i -= 2) {
            System.out.print(((n >> i) & 1) + " ");
        }
        System.out.println();
        for (int i = 30; i >= 0; i -= 2) {
            System.out.print(((n >> i) & 1) + " ");
        }
    }
    public static void main8(String[] args) {
        Scanner scan = new Scanner(System.in);
        int count = 3;
        while(count != 0) {
            System.out.println("请输入密码，还有" + count + "次机会。");
            String arr = scan.nextLine();
            if(arr.equals("123")) {
                System.out.println("输入正确！");
                break;
            } else {
                System.out.println("输入错误!");
            }
            count--;
        }
    }
    public static void main7(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.printf("%d*%d=%d ",i ,j ,i * j);
            }
            System.out.println();
        }
    }
    public static void main6(String[] args){
        Scanner scan = new Scanner(System.in);

        while(scan.hasNextLine()){
            int n = scan.nextInt();
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if(i == j || i + j == n-1) {
                        System.out.print('*');
                    } else {
                        System.out.print(' ');
                    }
                }
                System.out.println();
            }
        }
    }
    public static void main5(String[] args){
        int sum = 0;
        int tmp = 0;
        int count = 0;
        for (int i = 1; i < 999999; i++) {
            sum = 0;
            tmp = 0;
            count = 0;
            //求位数
            tmp = i;
            while(tmp != 0){
                count++;
                tmp /= 10;
            }
            //求每位数的位数次方的和
            tmp = i;
            while(tmp != 0){
                sum += Math.pow(tmp%10,count);
                tmp /= 10;
            }

            if(sum == i){
                System.out.println(sum);
            }
        }
    }
    public static void main4(String[] args){
        double sum = 0;
        int flag = 1;
        for (int i = 1; i <= 100; i++) {
            sum += 1.0 / i * flag;
            flag = -flag;
        }
        System.out.println(sum);
    }
    public static void main3(String[] args)
    {
        int n = -1;
        int count = 0;

        while(n != 0){
            n = n & (n-1);
            count++;
        }

        System.out.println(count);
    }
    public static void main2(String[] args){
        int n = -1;
        int count = 0;

        while(n != 0){
            if((n & 1) == 1){
                count++;
            }
            n >>>= 1;
        }

        System.out.println(count);
    }
    public static void main1(String[] args)
    {
        int c = 0;
        int b;
        int a = -1;
        for (int i = 0; i < 32; i++) {
            b = a & 1;
            if(b == 1){
                c++;
            }
            a >>= 1;
        }
        System.out.println(c);
    }
}
